package tests;

import javax.swing.*;
import java.awt.*;

public class TextComponentFrame extends JFrame{
	public static final int TEXT_AREA_ROWS=8,
	TEXT_AREA_COLUMNS=20;
	public TextComponentFrame() throws HeadlessException {
		var textField=new JTextField();
		JPasswordField passwordField=new JPasswordField();

		JPanel northPanel=new JPanel();
		northPanel.setLayout(new GridLayout(2,2));
		northPanel.add(new JLabel("User Name:",SwingConstants.RIGHT));
		northPanel.add(textField);
		northPanel.add(passwordField);

		add(northPanel,BorderLayout.NORTH);

		JTextArea textArea=new JTextArea(TEXT_AREA_ROWS,TEXT_AREA_COLUMNS);
		JScrollPane scrollPane=new JScrollPane(textArea);

		add(scrollPane,BorderLayout.SOUTH);

		setSize(0x400,0x200);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
	}

	public static void main(String[] args) {
		new TextComponentFrame().setVisible(true);
	}
}
